#ifndef LAURIN_80211_MONITOR_DEVICE_H_
#define LAURIN_80211_MONITOR_DEVICE_H_

#include "laurin-device.h"
#include <glibmm/ustring.h>


/**
 * This class represent a network device that works as a monitor.
 * It can be connected to some network or not: this doesn't make difference.
 * The only constraints is that work only with wireless device that use's the mac80211 stack and the
 * radiotap header is supported (see http://www.radiotap.org)
 *
 * The wireless API are not supported. See http://www.linuxwireless.org/ for more informations.
 *
 * If device isn't present, it can be created using the mac80211 wireless stack.
 * For this reason it requires the "master" interface name (see mac80211 architecture).
 */
class Laurin80211MonitorDevice : public LaurinDevice
{
	public:

		Laurin80211MonitorDevice(const Glib::ustring& ifaceName, const Glib::ustring& masterIfaceName);
		virtual ~Laurin80211MonitorDevice();

		LaurinDevice* getMasterDevice() const;
		virtual bool isInitialized() const;


	protected:

		virtual bool setCaptureOptions();

	private:

		LaurinDevice* _masterDevice;
		bool _ready;

		bool createMonitorDevice();
		void removeMonitorDevice();
		bool netlinkSendOperation(short op);
};

#endif
